import request from '@/utils/http'
export const createOrderAPI = (List, userInfo) => {
    return request({
        url: '/createOrder',
        method: 'post',
        data: {
            selectionList: List,
            user: userInfo
        }
    })
}
export const getTolPriceAPI = (selectionList) => {
    return request({
        url: '/getTolPrice',
        method: 'post',
        data: {
            selectionList
        }
    })
}
export const previewOrderAPI = (selectionList) => {
    return request({
        url: 'previewOrder',
        method: 'post',
        data: {
            selectionList
        }
    })
}
export const getRefundListByContentAPI = (content) => {
    return request({
        url: '/getRefundListByContent',
        method: 'post',
        data: {
            content
        }
    })
}
export const getRefundListByStateAndContentAPI = (state, content) => {
    return request({
        url: '/getRefundListByStateAndContent',
        method: 'post',
        data: {
            content,
            state
        }
    })
}
export const getOrderListAPI = () => {
    return request({
        url: '/getOrderList',
        method: 'get'
    })
}
export const getOrderListByUidAPI = (uid) => {
    return request({
        url: '/getOrderListByUid',
        method: "post",
        data: {
            uid
        }
    })
}
export const getOrderListByContentAPI = (content) => {
    return request({
        url: '/getOrderListByContent',
        method: 'post',
        data: {
            content
        }
    })
}
export const getOrderListByStateAndContentAPI = (state, content) => {
    return request({
        url: '/getOrderListByStateAndContent',
        method: 'post',
        data: {
            state,
            content
        }
    })
}
export const getOrderListByUidAndStateAPI = (uid, state) => {
    return request({
        url: '/getOrderListByUidAndState',
        method: "post",
        data: {
            uid,
            state
        }
    })
}
export const updateOrderAddressAPI = (oid, address) => {
    return request({
        url: '/updateOrderAddress',
        method: 'post',
        data: {
            oid,
            address
        }
    })
}
export const getOrderLogistics = (oid) => {
    return request({
        url: '/getLogistics',
        method: 'post',
        data: {
            oid
        }
    })
}
export const reOrderAPI = (oid) => {
    return request({
        url: '/reOrder',
        method: 'post',
        data: {
            oid
        }
    })
}
// export const getOrderListAPI = (id, state) => {
//     return request({
//         url: '/getOrderList',
//         method: 'post',
//         data: {
//             id,
//             state
//         }
//     })
// }
export const getOrderDetailsAPI = (oid) => {
    return request({
        url: '/getOrderDetail',
        method: 'post',
        data: {
            oid
        }
    })
}
export const refundAPI = (oid, uid, content) => {
    return request({
        url: '/refund',
        method: 'post',
        data: {
            oid,
            uid,
            content
        }
    })
}
export const cancelRefundAPI = (oid) => {
    return request({
        url: '/cancelRefund',
        method: 'post',
        data: {
            oid
        }
    })
}
export const checkRefundStateAPI = (oid) => {
    return request({
        url: '/checkRefundState',
        method: 'post',
        data: {
            oid
        }
    })
}
export const deliverGoodAPI = (oid) => {
    return request({
        url: '/deliverGood',
        method: 'post',
        data: {
            oid
        }
    })
}
export const refuteRefundAPI = (oid) => {
    return request({
        url: '/refuteRefund',
        method: 'post',
        data: {
            oid
        }

    })
}
export const agreeRefundAPI = (oid) => {
    return request({
        url: '/agreeRefund',
        method: 'post',
        data: {
            oid
        }
    })
}